<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('现场安装情况调查表新增及修改')" />
	<th:block th:include="include :: businessCSS" />
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
            <th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
			<div style="margin:0px 10px">
		    	<table class="layui-table" lay-size="sm" style="margin:0px">
			    <tbody>
			      <tr>
			        <td class="table-title" rowspan="3">现场条件</td>
			        <td class="table-title text_l">机房环境符合要求，设备上方无空调或水管切上方留有1米以上空间</td>
			        <td><input type="hidden" name="bXc1" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bXc1" id="bXc1" ></td>
			        <td class="table-title text_l">UPS安装位置已确定，预留合理的维修空间</td>
			        <td><input type="hidden" name="bXc2" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bXc2" id="bXc2"></td>
			      </tr>
			      <tr>
			        <td class="table-title text_l">电池柜安装位置已确定</td>
			        <td><input type="hidden" name="bXc3" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bXc3" id="bXc3"></td>
			        <td class="table-title text_l">输入电源线材及空开（非漏电保护开关）符合要求并已预留足够长度接入UPS</td>
			        <td><input type="hidden" name="bXc4" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bXc4" id="bXc4"></td>
			      </tr>
			      <tr>
			        <td class="table-title text_l">输出电源线材已预留足够长度接入UPS</td>
			        <td><input type="hidden" name="bXc5" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bXc5" id="bXc5"></td>
			        <td></td>
			        <td></td>
			      </tr>
			      <tr>
			        <td class="table-title">送电条件</td>
			        <td class="table-title text_l">现场可给UPS输入电源送电</td>
			        <td><input type="hidden" name="bSd1" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bSd1" id="bSd1" ></td>
			        <td class="table-title text_l">现场可给负载送电</td>
			        <td><input type="hidden" name="bSd2" value="false"><input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bSd2" id="bSd2"></td>
			      </tr>
			    </tbody>
			  </table>
		  </div>
    	</div>
	    <div class="mid-content">
	        <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
	    </div>
	   	<th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,table,laydate,element;//定义layui模块
eachFields();//明细表格中的字段遍历
layui.use(['laydate', 'table','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,table = layui.table,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	layui.element.render();
 	$.get("/business/installstatecheck/listbynid?nid="+nid,function(data){
		$.each(data.data,function(k,v){
			dataStr.push(v);
		});
		initTable();//初始化表格
	});
 	//初始送电条件和现场条件赋值
 	$.each(t_fields,function(v,k){
 		if(k.fieldContent)$('#'+k.fields).attr('checked','checked');
 		if(gridColumns.readOnly)$('#'+k.fields).attr('disabled','disabled');
 	})
 	//监听开关动作
	form.on('switch(switchTable)', function(obj){
		var cChecked=obj.elem.checked?true:false,cIndex=$(this).attr('tindex'),cName=$(this).attr('tname');
 		table.cache.dhtable[cIndex][cName]=cChecked;
    });
 	form.render();
	toolbarEvent();//通用表格头部工具栏事件监听
	monitorSort();//监听排序——重载赋值渲染
})
</script>
</body>
</html>